﻿using AiFrame.InterfaceLib.Data.Patterns;

namespace AiFrame.InterfaceLib.Data.Provider
{
    /// <summary>
    /// Represents a class which database providers can
    /// register in.
    /// </summary>
    public interface IDbProviderRegistration
    {
        /// <summary>
        /// Registers a new database provider.
        /// </summary>
        /// <param name="dbProvider">The provider.</param>
        void RegisterProvider(IDbProvider dbProvider);

        /// <summary>
        /// Unregisters a specific database provider.
        /// </summary>
        /// <param name="dbProvider">The provider.</param>
        void UnregisterProvider(IDbProvider dbProvider);

        /// <summary>
        /// Gets or sets the active provider.
        /// The active provider is used to establish the
        /// database connection.
        /// </summary>
        /// <returns></returns>
        IDbProvider ActiveProvider { get; set; }

        /// <summary>
        /// Returns the list of all registered providers.
        /// </summary>
        /// <returns>The provider list.</returns>
        ObservableCollection<IDbProvider> Providers { get;}
    }
}
